<template>
 <div class="trapezoid">
   <div class="trapezoid-angle"></div>
   <span class="title">{{ title  }}</span>
 </div>
 <div class="parallelogram" style="width: 18px;"></div>
 <div class="parallelogram" style="margin-left: 6px;"></div>
</template>

<script setup>
const props = defineProps({
  title: {
    required: true,
    type: String,
    default: '默认标题'
  },
})
</script>

<style lang='scss' scoped>
@import '../../assets/styles/variables.module.scss';

.trapezoid {
  font-size: 18px;
  width: 165px; 
  height: 36px; 
  background-color: $--color-bg-primary; 
  position: relative;
  border-radius: 4px;
}


.trapezoid-angle {
  background-color: $--color-bg-primary; 
  border-radius: 4px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: skew(-30deg);
  transform-origin: bottom left;
}


.title {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: $--color-primary;
  line-height: 36px;
  font-size: 18px;
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  padding-left: 20px;
}


.parallelogram {
  border-radius: 2px;
  width: 14px;
  height: 36px;
  margin-left: 8px;
  background-color: $--color-bg-primary; 
  // background-color: #333;
  transform: skew(-30deg) !important;
  transform-origin: bottom left;
}

</style>